#! /usr/bin/expect
set ip 192.168.1.108
set user root
set password 123456
set timeout 5

spawn scp -r /scripts/ip.txt $user@$ip:/tmp

expect {
	"yes/no" { send "yes\r";exp_continue}
	"password:" { send "$password\r"};
}
expect eof
